;****************************************
group

group  soil range z 1 2   ;group
prop  bulk 7.8e6 shear 3.0e6 coh 10e3 fric 15 ran group soil   ;groupֵ
model null range group soil
model elastic range group soil

range

range name trench x 0 1  y 0 4  z 0 2
model null range trench

model null range x=2,4 y=2,6 z=5,10

range name Big_Brick x -3 3 y -2 2 z -1 1
model elastic range Big_Brick
prop bulk 1e8 shear 1e8 range Big_Brick


range name Layer1 plane dip 0 dd 0 ori 0 0 0 above
range name Layer2 plane dip 0 dd 0 ori 0 0 0 below

macro

macro Sand 'bulk 1e8 shear 0.5e8 coh 0 tens 0 fric 35'
macro Clay 'bulk 1e7 shear 0.3e7 coh 1e7 tens 0 fric 0'
prop sand range  Layer1
prop clay range  layer2


macro Pt0 'p0 0 0 0'
macro Pt1 'p1 add 10 0 0'
macro Pt2 'p2 add 0 10 0'
macro Pt3 'p3 add 0 0 10'
macro Model_Size 'size 4 5 6'

macro Big_Brick 'gen zone brick Pt0 Pt1 Pt2 Pt3 Model_Size'
Big_Brick
macro 'Pt0' 'p0 15 15 15'
gen Big_Brick ; this will cause an error



group  range  macro 

Using different object types to do the same job

using a RANGE object ...
range name Big_Brick x = (-3,3) y = (-2,2) z = (-1,1)
model null range Big_Brick

using a GROUP object ...
group Big_Brick range x = (-3,3) y = (-2,2) z = (-1,1)
model null range group Big_Brick

using a macro object ...
macro Big_Brick 'x = (-3,3) y = (-2,2) z = (-1,1)'
model null range Big_Brick



gen zone brick size 10,10,10
macro SiltySand 'bulk 1.5e8 shear 0.3e8'
macro ClayeyGravel 'bulk 1.5e8 shear 0.6e8 fric 30 coh 5e6 ten 8.66e6'

model elas range z 5 10
prop SiltySand range z 5 10

model mohr range z 0 5
prop ClayeyGravel range z 0 5

;****************************************


ͼ   x   y  z   m
ctr+r   ԭ
ctr+p   ͼƬ
ctr+z   ѡ 
ctr+g   ͼΪɫͼ
shift  +  x   y  z   m  ת  
edit---copy to clipboard----ճ word

;****************************************

ini xdis 0 ydis 0  zdis 0
set grav  0 0 -9.81
set mech force=50   'ƽС50nֹͣ

;****************************************
hist

hist  reset   'ʷϢ

set hist_rep 1   'ÿһʱ¼һ
hist n=5          'ÿ5ʱ¼һ
hist write 7 v 8 file xx.txt
hist gp zdisp 4,4,8
;****************************************
log
set logfile xx.log
set log on

print 

set log off
;****************************************
Ƭ

pl set plane ori   norm'λ

pl con zd  plane     'ʾ


pl con sxx outline on   ;鿴ˮƽӦͼ outline onʾʾģ͵ı߽磬ĬΪ off

;****************************************     
fish  Ҫ

  if  then

             
         else
             
        endif



      command

             

        endcommand


    loop n1,21

             

    endloop


     loop while   

             

     endloop



   caseof   
       
   case n1
    
   case   n2
     
   endcase

;****************************************


   =  #  > <  >=  <=
  ʱ  Ҫӣͼ  -  

;****************************************
Ԫ/ڵ
   p_z = zone_head
  
   loop while p_z # null
    
    p_z = z_next(p_z)
    endloop


    p_gp = gp_head
     
    loop while p_gp # null
    
    p_gp = gp_next(p_gp)
    endloop

;****************************************

stringӣļ
save_file=string(n)+'_step.sav'

 D3DECFile = 'D3dec_Model.dat' 

FlacFile  = 'Flac3D_Model.dat'

file_name='7-6_add'+string(n)+'.sav'

save  file_name

cal  flacfile

;****************************************

table     ftd12859/114)

table 1 name  load_settlement    '±

xtable(n,s)=   ԱΪnı ĵsСxниֵ

ytable(n,s)=   ԱΪnı ĵsСyниֵ


plot table 1 line

plot table 1 both    '㡢ͬʱʾ



;****************************************
Interface  ıμftd128.pdf53/114

Structural Elements  ıμftd128.pdf64/114
;****************************************
ϸ gp   zone   μftd128.pdf40/114

gp /

gp_zdisp(p_gp):ַΪp_gpĽڵz

gp_near(x,y,z):õ(x,y,z)Ľڵַ
gp_id(p_gp):ڵID
gp_next(p_gp):




print gp pos ran id 59    '59Žڵλ

   ע⣺   ڵָѭǴIDСĵַʼġ


zone 
z_sig3(p_z)  'СӦ    z_sig1(p_z)    'Ӧ
z_prop(p_z,'young')

;****************************************
def install
pnt = zone_head
loop while pnt # null
z_depth = -z_zcen(pnt)
y_mod = y_zero + cc * sqrt(z_depth)
z_prop(pnt, 'shear') = y_mod / (2.0*(1.0+P_ratio))
z_prop(pnt, 'bulk') = y_mod / (3.0*(1.0-2.0*P_ratio))
pnt = z_next(pnt)
end_loop
end
set p_ratio=0.25 y_zero=1e7 cc=1e8
install
plot block prop bulk
;****************************************

ûԶ ڵ㡢Ԫ

config  zextra  n    'ȽеԪ 
config  gpextra m    'Ƚнڵ 
z_extra(p_z,n)


;--- test of stress rotation ---
config gpextra 2
call fishcall.fis
gen zone brick size 1 1 1
mo el
prop she 300 bu 300
def ini_coord
pnt = gp_head
loop while pnt # null
gp_extra(pnt,1) = sqrt((gp_xpos(pnt)-xc)^ 2+(gp_zpos(pnt)-zc)^ 2)
gp_extra(pnt,2) = atan2((gp_xpos(pnt)-xc),(zc-gp_zpos(pnt)))
pnt = gp_next(pnt)
endloop
end
set xc=0 zc=0
ini_coord


;****************************************

title

title 'Tutorial Examples'

plot set title text 'Mesh for trench example'


;****************************************
Ӧݶ


ini dens 2000
ini szz -40e3 grad 0 0 20e3 ran z 0 2
ini syy -20e3 grad 0 0 10e3 ran z 0 2
ini sxx -20e3 grad 0 0 10e3 ran z 0 2
set grav 0 0 -10

ini xdis=0 ydis=0 zdis=0
hist gp xdisp 1,0,0
hist gp zdisp 0,0,2


apply syy = -20e6 grad 0,0,20e5 range y -20.1,-19.9 z 0,10

   With this command, a yy-stress component is applied to boundary faces located between y = -20.1
and -19.9. The yy-stress varies linearly with z from yy = 0 at z = 10 to yy = -20e6 at z = 0.
    S=S(0)+gx*x+gy*y+gz*z   ' gx gy gz  ֱӦgrad 0,0,20e5 е 

;****************************************
״

gen zone brick size 6,8,8 p0 -10, -10, -20 &
p1 10, -10, -20 &
p2 -10, 10, -20 &
p3 -10, -10, 0
plot surf

gen zone brick size 6,8,8 p0 -10, -10, -20 &
p1 10, -10, -20 p2 -10, 10, -20 &
p3 -10, -10, 0 p4 10, 10, -20 &
p5 -10, 10, 10 p6 10, -10, 0 &
p7 10, 10, 10
plot surf

gen zone radbrick &
p0 (0,0,0) p1 (10,0,0) p2 (0,10,0) p3 (0,0,10) &
size 3,5,5,7 &
ratio 1,1,1,1.5 &
dim 1 4 2 fill      'The fill keyword fills the brick region with zones
plot surf

gen zone radbrick &
p0 (0,0,0) p1 (10,0,0) p2 (0,10,0) p3 (0,0,10) &
size 3,5,5,7 &
ratio 1,1,1,1.5 &
dim 1 4 2 fill
gen zone reflect dip 0 dd 90
gen zone reflect dip 90 dd 90
;
; identify the trench

gen zone radc &
dim 3 3 3 3 &
ratio 1 1 1 1.2 &
size 3 8 8 5 &
edge 10 &
p0 100 95 100 &
fill
gen zone reflect dip 90 dd 90 ori 100 100 100
gen zone reflect dip 0 dd 0 ori 100 100 100

;****************************************

cable 

sel cable beg 1.0,0.4,1.5 end 5.0,0.4,1.5 nseg 4
sel cable beg 1.0,0.4,0.5 end 5.0,0.4,0.5 nseg 4
sel cable beg 1.0,1.2,1.5 end 5.0,1.2,1.5 nseg 4
sel cable beg 1.0,1.2,0.5 end 5.0,1.2,0.5 nseg 4
sel cable prop emod 2e9 ytens 1e8 xcarea 1.0 &
gr_coh 1e10 gr_k 2e9 gr_per 1.0

;****************************************

plot create GravV
plot set plane dip=90 dd=0 origin=3,4,0
plot set rot 15 0 20
plot set center 2.5 4.2 4.0
plot add bound behind
plot add bcont szz plane
plot add axes
plot show